import {lazy} from "react"
import {Navigate} from "react-router-dom"
const Login = lazy(()=>import("../pages/Login"))
const Home = lazy(()=>import("../pages/home"))
const Achievement = lazy(()=>import("../pages/index/Achievement")) // 成绩管理
const Exammanger = lazy(()=>import("../pages/index/Exammanger")) // 考试管理
const ReportForm = lazy(()=>import("../pages/index/Reportform")) // 报表管理    (管理员可见)
const Testpaperi = lazy(()=>import("../pages/index/Testpaper")) // 试卷管理
const TestManger = lazy(()=>import('../pages/index/Tsetmanager')) // 测试管理
const NotFinde = lazy(()=>import("../pages/Notfind"))
const Homerouter = [  // 二级路由
    {
        path:"/home/achieve",
        element:<Achievement></Achievement>
    },
    {
        path:"/home/exammanger",
        element:<Exammanger></Exammanger>
    },
    {
        path:"/home/reportForm",
        element:<ReportForm></ReportForm>
    },
    {
        path:"/home/testpaperi",
        element:<Testpaperi></Testpaperi>
    },
    {
        path:"/home/testManger",
        element:<TestManger></TestManger>
    }
]
const routerconfig = [
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/home",
        element:<Home></Home>,
        children:Homerouter
    },
    {
        path:"*",
        element:<NotFinde></NotFinde>
    },
    {
        path:"/",
        element:<Navigate to="/login"></Navigate>
    }
]


export default routerconfig